package org.gbis.openbus.db;

import java.sql.*;

import org.gbis.openbus.*;

import com.sbmoon.db.*;
import com.sbmoon.web.Request;

public class DbManagerFindPath extends DbManager {

	@Override
	public String getSqlFileName() {
		return "sql600_findPath.sql";
	}

	@Override
	public Item getItem(QueryResult qr) {
		FindPath findPath = new FindPath();

		findPath.setTransfer( qr.getInteger("transfer"));
		findPath.setRouteId( qr.getString("routeId"));
		findPath.setRouteName( qr.getString("routeName"));
		findPath.setRouteType( qr.getString("routeType"));
		findPath.setTransRouteId( qr.getString("TransRouteId"));
		findPath.setTransRouteName( qr.getString("TransRouteName"));
		findPath.setTransRouteType( qr.getString("TransRouteType"));
		findPath.setStartStationId( qr.getString("startStationId"));
		findPath.setStartStationName( qr.getString("startStationName"));
		findPath.setTransOffStationId( qr.getString("transOffStationId"));
		findPath.setTransOffStationName( qr.getString("transOffStationName"));
		findPath.setTransOnStationId( qr.getString("transOnStationId"));
		findPath.setTransOnStationName( qr.getString("transOnStationName"));
		findPath.setEndStationId( qr.getString("endStationId"));
		findPath.setEndStationName( qr.getString("endStationName"));
		findPath.setStartRouteSeq( qr.getInteger("startRouteSeq"));
		findPath.setTransOffRouteSeq( qr.getInteger("transOffRouteSeq"));
		findPath.setTransOnRouteSeq( qr.getInteger("transOnRouteSeq"));
		findPath.setEndRouteSeq( qr.getInteger("endRouteSeq"));
		findPath.setStartDistance( qr.getDouble("startDistance"));
		findPath.setEndDistance( qr.getDouble("endDistance"));
		findPath.setAvgTime( qr.getInteger("avgTime"));

		return findPath;
	}

	private DbManagerFindPath() {
	}

	public static DbManagerFindPath getDbManager() {
		if( true ) {
			return new DbManagerFindPath();
		}
		return dbManager;
	}

	private static final DbManagerFindPath dbManager = new DbManagerFindPath();

	public static void main(String[] args) throws Exception {

		SearchResult searchResult = SearchResult.getNewSearchResult();

		getDbManager().getSearchResult( true, searchResult , 200016 , 418560, 200626, 418670 );

	}

}
